<template>
  <div>
    <!-- 表头 -->
    <el-page-header @back="goBack" :content="content"> </el-page-header>
    <!-- 表单 -->
    {{form}}
    <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="名称">
    <el-input v-model="form.name"></el-input>
  </el-form-item>
  <el-form-item label="类型">
    <el-input v-model="form.type"></el-input>
  </el-form-item>
  <el-form-item label="介绍">
    <el-input v-model="form.introduce"></el-input>
  </el-form-item>
  <el-form-item label="邮箱">
    <el-input v-model="form.email"></el-input>
  </el-form-item>
  <el-form-item label="联系方式">
    <el-input v-model="form.telephone"></el-input>
  </el-form-item>
  <el-form-item label="应用程序密钥">
    <el-input v-model="form.appKey"></el-input>
  </el-form-item>
  <el-form-item label="安全密钥">
    <el-input v-model="form.secretKey"></el-input>
  </el-form-item>
  <el-form-item label="创建时间">
    <el-input v-model="form.createTime"></el-input>
  </el-form-item>

  <el-form-item label="经度">
    <el-input v-model="form.longitude"></el-input>
  </el-form-item>
  <el-form-item label="纬度">
    <el-input v-model="form.latitude"></el-input>
  </el-form-item>
    





      <el-form-item>
        <div style="text-align:right">
          <el-button type="primary" @click="submitHandler">提交</el-button>
        </div>
      </el-form-item>
    </el-form>


  </div>
</template>


<script>
import { post } from '@/utils/request'
export default {
  data(){
    return {
      content:"新增应用管理信息",
      form:{}
    }
  },
  methods:{
    // 提交
    submitHandler(){
      let url = "http://localhost:8888/application/saveOrUpdate"
      post(url,this.form).then(resp =>{
        // 提示
        this.$message({type:"success",message:resp.message})
        // 返回列表页面
        this.goBack();
      })
    },
    // 返回
    goBack(){
      this.$router.go(-1)
    }
  },
  created(){
    // 页面加载出来的时候，将路由中的参数拿到，放到this.form 中
    this.form = this.$route.query;
  }

}
</script>
<style lang="sass" scoped>

</style>